using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class Setting
    {
            public long ID{get;set;}
            public string SettingName{get;set;}
            public string SettingValue{get;set;}
            public string Description{get;set;}
         
        public Setting()
        {       
                            SettingName ="";   
                            SettingValue ="";   
                            Description ="";   
        }
        
       static Setting DynamicCast<T>(object row_data, object row_header) where T : Setting
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Setting ret = new Setting();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "SettingName":
                        ret.SettingName = ConvertObject.ToString(dt[column]);
                       break;
                      case  "SettingValue":
                        ret.SettingValue = ConvertObject.ToString(dt[column]);
                       break;
                      case  "Description":
                        ret.Description = ConvertObject.ToString(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
